package collection;

import java.util.List;

public class CollectionDistinctUtils {

    public static List<Integer> distinctByDoubleFor(List<Integer> list) {
        for (int i = list.size() - 1; i > 0; ) {
            for (int j = list.size() - 2; j > 0; j--) {
                if (list.get(i).equals(list.get(j))) {
                    i--;
                    list.remove(j);
                }
            }
        }
        return list;
    }

}
